<%@ page import="com.wuming.caiwu.security.SecurityHander" %><%--
  Created by IntelliJ IDEA.
  User: zengyao
  Date: 2018/6/30
  Time: 14:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/share/taglib.jsp" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta charset="utf-8">
    <title>店铺信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${allServerPath}static/layui/layui/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
    <style>
        .layui-upload button {
            background: none;
            position: absolute;
            top: 10px;
            left: 110px;
            width: 82px;
            height: 82px;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body style="background-color: #f0f2f5;">
<div style="padding: 15px;margin: 15px;background-color: #fff;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>基本信息</legend>
    </fieldset>
    <form class="layui-form" id="editUser" lay-filter="storeInfo">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">美团店铺ID</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="openShopUuid" class="layui-input" type="text" autocomplete="off" placeholder="请输入美团店铺ID"
                           value="${store['openShopUuid']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">抖音店铺ID</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="douyinPoiId" class="layui-input" type="text" autocomplete="off" placeholder="请输入抖音店铺ID"
                           value="${store['douyinPoiId']}">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">多店版总店铺ID</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="parentStoreId" class="layui-input" type="text" autocomplete="off" placeholder="多店版总店铺ID"
                           value="${store['parentStoreId']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">节假日套餐</label>

                <div class="layui-input-inline">
                    <input type="radio" name="holidayMeal" value="0" title="关闭" checked="">
                    <input type="radio" name="holidayMeal" value="1" title="开启">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">美团appid</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="meituanAppid" class="layui-input" type="text" autocomplete="off" placeholder="美团appid"
                           value="${store['meituanAppid']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">美团appsecret</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="meituanAppsecret" class="layui-input" type="text" autocomplete="off" placeholder="美团appsecret"
                           value="${store['meituanAppsecret']}">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">美团重定向地址</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="meituanRedirect" class="layui-input" type="text" autocomplete="off" placeholder="美团重定向地址"
                           value="${store['meituanRedirect']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">流量到期时间</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" id="simOuttimeStr" name="simOuttimeStr" class="layui-input" type="text" autocomplete="off" placeholder="流量到期时间"
                           value="${store['simOuttimeStr']}">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">营业状态</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="onlineStatus" class="layui-input" type="text" autocomplete="off" placeholder="请输入营业状态"
                           value="${store['onlineStatus']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">门店描述</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="description" class="layui-input" type="text" autocomplete="off" placeholder="请输入门店描述"
                           value="${store['description']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">服务电话</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="servicePhone" class="layui-input" type="text" autocomplete="off" placeholder="请输入服务电话"
                           value="${store['servicePhone']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">是否单店</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="isDandian" class="layui-input" type="text" autocomplete="off" placeholder="请输入是否单店"
                           value="${store['isDandian']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">商户号</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="mchId" class="layui-input" type="text" autocomplete="off" placeholder="请输入商户号"
                           value="${store['mchId']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">服务商商户号</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="serverMchId" class="layui-input" type="text" autocomplete="off" placeholder="请输入服务商商户号"
                           value="${store['serverMchId']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">服务商证书路径</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="serverCertPath" class="layui-input" type="text" autocomplete="off" placeholder="请输入服务商证书路径"
                           value="${store['serverCertPath']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">服务商APIKEY</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="serverKey" class="layui-input" type="text" autocomplete="off" placeholder="请输入服务商APIKEY"
                           value="${store['serverKey']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">分账比例</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="scale" class="layui-input" type="text" autocomplete="off" placeholder="请输入分账比例"
                           value="${store['scale']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">是否分账</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="profitSharing" class="layui-input" type="text" autocomplete="off" placeholder="请输入是否分账(Y代表分账)"
                           value="${store['profitSharing']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">店铺名</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="name" class="layui-input" type="text" autocomplete="off" placeholder="请输入店铺名"
                           value="${store['name']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">分账接收方名</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="receiverName" class="layui-input" type="text" autocomplete="off" placeholder="请输入分账接收方名"
                           value="${store['receiverName']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">分账接收方商户号</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="receiverMchid" class="layui-input" type="text" autocomplete="off" placeholder="请输入分账接收方商户号"
                           value="${store['receiverMchid']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">服务商appid</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="serverAppid" class="layui-input" type="text" autocomplete="off" placeholder="请输入服务商appid"
                           value="${store['serverAppid']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">新订单通知模板</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="templateidNew" class="layui-input" type="text" autocomplete="off" placeholder="请输入新订单通知模板"
                           value="${store['templateidNew']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">取消订单通知模板</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="templateidCancel" class="layui-input" type="text" autocomplete="off" placeholder="请输入取消订单通知"
                           value="${store['templateidCancel']}">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">订单完成通知模板</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="templateidComplete" class="layui-input" type="text" autocomplete="off" placeholder="请输入订单完成通知"
                           value="${store['templateidComplete']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 120px">订单充值通知模板</label>

                <div class="layui-input-inline">
                    <input style="width: 450px" name="templateidChongzhi" class="layui-input" type="text" autocomplete="off" placeholder="请输入订单充值通知"
                           value="${store['templateidChongzhi']}">
                </div>
            </div>
        </div>

        <div class="layui-row" style="text-align: center;">
            <button class="layui-btn layui-btn-normal" type="button" name="btnSave" id="saveUser">保存信息</button>
        </div>
        <input type="hidden" name="id" value="${store['id']}"/>
    </form>

    <script src="${allServerPath}static/layui/layui/layui.js"></script>
    <script>
        layui.use(['form', 'layedit', 'laydate', 'jquery', 'upload'], function () {
            var form = layui.form
                , layer = layui.layer
                , layedit = layui.layedit
                , laydate = layui.laydate
                , $ = layui.jquery
                , upload = layui.upload;

            laydate.render({
                elem: '#simOuttimeStr',
                type: 'datetime',
                format: 'yyyy-MM-dd HH:mm:ss'
            });

            var holidayMeal = "${store['holidayMeal']}";
            if(undefined != holidayMeal && "" != holidayMeal){
                $("input[name='holidayMeal'][value='" + holidayMeal + "']").attr("checked", true);
                form.render();
            }


            $("#saveUser").click(function () {
                $.ajax({
                    type: "post",
                    url: "${allServerPath}/web/store/save.htmls",
                    data: $('#editUser').serialize(),// 你的formid
                    dataType: "JSON",
                    success: function (data) {
                        if (data.success) {
                            layer.msg("保存成功.");
                        } else {
                            layer.msg("保存失败,请稍后重试.");
                        }
                    },
                    error: function (msg) {
                        layer.msg("保存失败.");
                    }
                });
            });

        });
    </script>
</div>
</body>
</html>
